//
//  TimingPatternDetailViewController.h
//  Portable Traffic Signal Assistor
//
//  Created by Hao Xu on 4/20/12.
//  Copyright (c) 2012 TTU. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TableSection.h"
#import "TimingPattern.h"
#import "SubSystem.h"
#import "Agency.h"
#import "Signal.h"
#import "XMLParser.h"
#import "TimeRange.h"
#import "TrafficSignalTimer.h"
#import "SignalMovementImageManager.h"
#import "TimeAdjustmentViewController.h"
#import "TimingPatternScheduleViewController.h"
#import "SignalAssistorDetailEditViewController.h"
#import "SignalDetailViewController.h"
#import "RealTimeSignalCell.h"
#import "NEMASignal.h"
#import "ExploreMapViewViewController.h"
#import "ActiveSignalMapViewController.h"
#import "CustomizedBarButtonItem.h"
#import "DynamicSignalCell.h"
#import "GPSRecordListController.h"
enum TextView{
    NameTextView = 1,
    CycleLengthTextView
    
} ;

enum Alert{
    RemoveTimeRangeAlert = 10,
    RemoveSignalAlert
    
} ;

@interface TimingPatternDetailViewController : UITableViewController<UIAlertViewDelegate, UITextViewDelegate, UITextFieldDelegate>

@property (nonatomic,retain) NSMutableArray * sections;
@property (nonatomic,retain) TableSection * timingPatternNameSection;
@property (nonatomic,retain) TableSection * cycleLengthNameSection;
@property (nonatomic,retain) TableSection * timeRangeListSection;
@property (nonatomic,retain) TableSection * signalListSection;
@property (nonatomic,retain) TableSection * linkButtonSection;
@property (nonatomic,retain) NSMutableArray *signalList;
@property (nonatomic,retain) UIButton *addSignalButton;
@property (nonatomic,retain) UIButton *addTimeRangeButton;
@property (nonatomic,retain) TimingPattern *timingPattern;
@property (nonatomic,retain) SubSystem *subSystem;
@property (nonatomic,retain) Agency *agency;
@property (assign) int publicSender;
@property (nonatomic,retain) UITextView * timingPatternNameTextView;
@property (nonatomic,retain) UITextField * timingPatternCycleTextView;
@property (nonatomic,retain) NSTimer * timer;
@property (nonatomic,retain) UILabel * masterTimeLabel;
@property (nonatomic,retain) UIButton *editScheduleButton;
@property (nonatomic,retain) UIButton *editSignalButton;
@property (nonatomic,retain) NSMutableArray *signalCellList;
@property (nonatomic,retain) NSMutableArray *dynamicSignalCellList;
@property (nonatomic,retain) SignalMovementImageManager *signalMovementImageManger;
- (void) clickAddSignalButton:(id)sender;
- (void) clickAddTimeRangeButton:(id)sender;
- (id) initWithNibNameAndTimingPattern:(NSString *)nibName agency:(Agency *)agency subSystem:(SubSystem *)subSystem timingPattern:(TimingPattern *)timingPattern bundle:(NSBundle *)nibBundle;
- (IBAction)textViewReturn:(id)sender;


@end
